<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>12-v-bind属性绑定</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <a v-bind:href="url1">京东</a>
      <a :href="url2">百度</a>
      <button @click="blank">点击跳转</button>
    </div>
    <script>
      Vue.config.keyCodes.hello = 65; // 65表示a， 只有按下a才会触发
      var vm = new Vue({
        el: '#app',
        data: {
          url1: 'http://www.jd.com',
          url2: 'http://www.baidu.com',
        },
        methods: {
          blank: function () {
            this.url2 = 'http://www.taobao.com';
          },
        },
      });
    </script>
  </body>
</html>
